package com.hu.demo1.utils;

public class StringUtil {
    /**
     * 生成指定长度的随机字符串
     */
    public static String getRandomString(int length) {
        String base = "";
        StringBuffer sb = new StringBuffer();
        for (int i = 0; i < length; i++) {
            int number = (int) (Math.random() * base.length());
            sb.append(number);
        }
        return sb.toString();
    }
}
